#include "mainwindow.h"
#include "databacemanager.h"
#include "logindialog.h"
#include <QApplication>
#include <QFile>
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QFile styleFile(":/style/style.qss");
    if(styleFile.open(QFile::ReadOnly))
    {
        QString styleSheet=QString(styleFile.readAll());
        a.setStyleSheet(styleSheet);
    }else{
        qWarning() <<"Failed to load stylesheet:"<<styleFile.errorString();
    }
    DataBaceManager::instance();
    LoginDialog logindlg;
    if(logindlg.exec()==QDialog::Accepted){
        MainWindow w;
        w.show();
        return a.exec();
    }
    return 0;
}
